package LC;

/**
 * @ClassName LC28
 * @Description: TODO
 * @Author hl
 * @Date 2021/4/9
 * @Version V1.0
 **/
public class LC28 {
    public static int strStr(String haystack, String needle) {
        int len1=haystack.length();
        int len2=needle.length();
        for(int start=0;start<=len1-len2;start++){
            if(haystack.substring(start,start+len2).equals(needle)){
                return start;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        System.out.println(strStr("mississippi","issi"));
    }

}
